#pragma once

extern int SelectedPlayer;

enum Submenu_s {
	MAIN = 0,
	AIMBOT = 1,
	VISUALS = 2,
	CLIENT_LIST = 3,
	SETTINGS = 4,
	LOBBY = 5,
	MENU = 6,
	CLIENT_OPTIONS = 7,
	CLIENT_OPTIONS_PAGE_2 = 8,
	CLIENT_OPTIONS_PAGE_3 = 9,
	CLIENT_RME_EXTRAS = 10,
	RME_PAGE_2 = 11,
	RME_EXTRAS = 12,
	RME_ALL_CLIENTS = 13,
	RME_MENU_RENAME_PRESETS = 14,
	RME_MAPS = 15
};

struct MenuItems_s {
	int currentOption;
	int optionCount;
	int submenu;
	int submenuLevel;
	int lastSubmenu[20];
	int lastOption[20];
	bool optionPress;
	bool optionPressX;
	bool leftPress;
	bool rightPress;
};

class Menu {
private:
	char* option;
	char temp[50];
public:

	void ResetVars();
	int GetOption();
	Menu(char* optionText = NULL);
	inline Menu Option();
	inline Menu Toggle(BOOL* toChange);
	template<typename T>
	inline Menu Editor(T* toEdit, T increments, T min, T max);
	template<typename T>
	inline Menu ArrayEditor(T arr, int size, int* identifier);
	inline Menu Submenu(int submenu);
	inline Menu PlayerSubmenu(int submenu);
	template<typename T>
	inline Menu Callback(T function);
	template<typename T, typename A>
	inline Menu Callback(T function, A a);
	template<typename T, typename A, typename B>
	inline Menu Callback(T function, A a, B b);
	template<typename T, typename A, typename B, typename C>
	inline Menu Callback(T function, A a, B b, C c);
	inline Menu ChangeBoolean(BOOL* toChange, BOOL value);
};

extern void HandleMenu();